import chromadb
chroma_client = chromadb.HttpClient(host='124.221.66.3', port=8000)

collection = chroma_client.get_or_create_collection(name="my_collection")

## 加入数据
# collection.add(
#     documents=["This is a document about engineer", "This is a document about steak"],
#     metadatas=[{"source": "doc1"}, {"source": "doc2"}],
#     ids=["id1", "id2"]
# )

results = collection.query(
    query_texts=["How to study IT?"],
    n_results=2
)

print(results)



